#include "JingleSession.h"
#include "Poco/Random.h"

namespace cm_nat
{
    JingleSession::JingleSession():
            m_role(CONTROLLING),
            m_listener(NULL),
            m_jingleManager(NULL)
    {

    }

    JingleSession::~JingleSession()
    {

    }

    void JingleSession::setSessionID(std::string sid)
    {
        m_sid = sid;
    }

    void JingleSession::setJingleManager(JingleManager* p_manager)
    {
        m_jingleManager = p_manager;
    }


    void JingleSession::setJID(JID jid)
    {
        m_jid = jid;
    }

    void JingleSession::setPeerJID(JID jid)
    {
        m_peerJid = jid;
    }


    std::string JingleSession::generateSid()
    {
        static Poco::Random sid_ramdom;
        std::string sid;
        sid.resize(16);

        for(int i =0; i<16; i++){
            sid[i] = (sid_ramdom.next()%26) + 65;
        }
        return sid;
    }

}